package data

import (
	"k8s.io/client-go/kubernetes"
	"learn/k8s/internal/config"
	"learn/k8s/internal/pkg/util"
)

type Data struct {
	k8s *kubernetes.Clientset
}

func InitData(val *config.DataConf) (c *Data, err error) {
	c = &Data{}
	if val.K8s.Path != "" {
		if err = c.initK8s(val.K8s); err != nil {
			return
		}
		util.L().Infow("[init k8s] success....")
	}
	return
}
